package com.siss.tenancy.elastic.model;

import com.siss.tenancy.finals.ElasticIndex;
import com.siss.tenancy.util.StringUtil;
import org.springframework.data.annotation.Id;
import org.springframework.data.elasticsearch.annotations.Document;
import org.springframework.data.elasticsearch.annotations.Field;
import org.springframework.data.elasticsearch.annotations.FieldType;
import org.springframework.data.elasticsearch.annotations.GeoPointField;
import org.springframework.data.elasticsearch.core.geo.GeoPoint;

import java.io.Serializable;

/**
 * 使用空格分词器，这样才会短语精准匹配
 */
@Document(indexName = ElasticIndex.MONTOR,shards = 1,replicas = 0)
public class SissMontorEsModel implements Serializable {

    private static final long serialVersionUID = -1L;

    @Id
    @Field(type = FieldType.Text)
    private String saId;
    //机构id
    @Field(type = FieldType.Text)
    private String soId;
    //分支机构id
    @Field(type = FieldType.Text)
    private String sobId;

    //名字
    @Field(analyzer = "whitespace",type = FieldType.Text)
    private  String name;

    //机构
    @Field(analyzer = "whitespace",type = FieldType.Text)
    private String organName;

    @Field(analyzer = "whitespace",type = FieldType.Text)
    private String organCode;

    //分支机构
    @Field(analyzer = "whitespace",type = FieldType.Text)
    private String branchName;

    @Field(analyzer = "whitespace",type = FieldType.Text)
    private String branchCode;

    //法人
    @Field(analyzer = "whitespace",type = FieldType.Text)
    private String legalPerson;

    @Field(analyzer = "whitespace",type = FieldType.Text)
    private String code;

    //坐标
    @Field(type = FieldType.Text)
    private String coordinate;

    //1直营，2加盟
    @Field(type = FieldType.Text)
    private String leagueType;

    @Field(type = FieldType.Text)
    private String nb="已年报";

    private String hiLightName;

    public String getHiLightName() {
        return hiLightName;
    }

    public void setHiLightName(String hiLightName) {
        this.hiLightName = hiLightName;
    }

    public String getOrganCode() {
        return organCode;
    }

    public void setOrganCode(String organCode) {
        this.organCode = organCode;
    }

    public String getBranchCode() {
        return branchCode;
    }

    public void setBranchCode(String branchCode) {
        this.branchCode = branchCode;
    }

    public String getNb() {
        if(StringUtil.isEmpty(businessAddress)){
            nb="未年报";
        }
        return nb;
    }

    public void setNb(String nb) {
        this.nb = nb;
    }

    //加盟公司名字
    @Field(analyzer = "whitespace",type = FieldType.Text)
    private String leagueName;

    //运营状态
    @Field(type = FieldType.Text)
    private String managerStatus;

    //1true,0false
    @Field(type = FieldType.Integer)
    private Integer black;

    //星级级别
    @Field(type = FieldType.Integer)
    private Integer starLevel;

    //是否备案，true false null
    @Field(type = FieldType.Boolean)
    private Boolean record;

    //备案地址
    @Field(analyzer = "whitespace",type = FieldType.Text)
    private String address;

    //营业地址
    @Field(analyzer = "whitespace",type = FieldType.Text)
    private String businessAddress;

    //区代码
    @Field(type = FieldType.Text)
    private String district;

    //市代码
    @Field(type = FieldType.Text)
    private String city;

    //省代码
    @Field(type = FieldType.Text)
    private String province;

    //行业类别代码
    @Field(type = FieldType.Text)
    private String tradeType;

    @Field(analyzer = "whitespace",type = FieldType.Text)
    private String moreTradeType;

    @Field(type = FieldType.Text)
    private String tradeTypeText;

    @Field(type = FieldType.Keyword)
    private String actorType;

    @Field(analyzer = "whitespace",type = FieldType.Text)
    private String mobile;

    @Field(analyzer = "whitespace",type = FieldType.Text)
    private String licenseNo;

    //状态代码
    @Field(type = FieldType.Text)
    private String workStatus;

    //状态中文
    @Field(type = FieldType.Text)
    private String workStatusText;

    @Field(type = FieldType.Text)
    private String complainCall;

    @Field(type = FieldType.Text)
    private String contactName;

    @Field(type = FieldType.Integer)
    private Boolean deleted;

    @Field(type = FieldType.Text)
    private String photoUrl;

    @Field(type = FieldType.Text)
    private String gobId;
    //备案状态
    @Field(type = FieldType.Integer)
    private Integer recordStatus;
    //备案状态字典
    @Field(type = FieldType.Text)
    private String recordStatusText;

    @GeoPointField
    private GeoPoint location;

    @Field(type = FieldType.Integer)
    private Integer starDaysCount;

    @Field(type = FieldType.Text)
    private String schoolDegree;

    public String getSchoolDegree() {
        return schoolDegree;
    }

    public void setSchoolDegree(String schoolDegree) {
        this.schoolDegree = schoolDegree;
    }

    public String getMoreTradeType() {
        return moreTradeType;
    }

    public void setMoreTradeType(String moreTradeType) {
        this.moreTradeType = moreTradeType;
    }

    public Integer getStarDaysCount() {
        return starDaysCount;
    }

    public void setStarDaysCount(Integer starDaysCount) {
        this.starDaysCount = starDaysCount;
    }

    public GeoPoint getLocation() {
        return location;
    }

    public void setLocation(GeoPoint location) {
        this.location = location;
    }

    public Integer getRecordStatus() {
        return recordStatus;
    }

    public void setRecordStatus(Integer recordStatus) {
        this.recordStatus = recordStatus;
    }

    public String getRecordStatusText() {
        return recordStatusText;
    }

    public void setRecordStatusText(String recordStatusText) {
        this.recordStatusText = recordStatusText;
    }

    public String getGobId() {
        return gobId;
    }

    public void setGobId(String gobId) {
        this.gobId = gobId;
    }

    public String getPhotoUrl() {
        return photoUrl;
    }

    public void setPhotoUrl(String photoUrl) {
        this.photoUrl = photoUrl;
    }

    public Boolean getDeleted() {
        return deleted;
    }

    public void setDeleted(Boolean deleted) {
        this.deleted = deleted;
    }

    public String getContactName() {
        return contactName;
    }

    public void setContactName(String contactName) {
        this.contactName = contactName;
    }

    public String getComplainCall() {
        return complainCall;
    }

    public void setComplainCall(String complainCall) {
        this.complainCall = complainCall;
    }

    public String getSaId() {
        return saId;
    }

    public void setSaId(String saId) {
        this.saId = saId;
    }

    public String getSoId() {
        return soId;
    }

    public void setSoId(String soId) {
        this.soId = soId;
    }

    public String getSobId() {
        return sobId;
    }

    public void setSobId(String sobId) {
        this.sobId = sobId;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getOrganName() {
        return organName;
    }

    public void setOrganName(String organName) {
        this.organName = organName;
    }

    public String getBranchName() {
        return branchName;
    }

    public void setBranchName(String branchName) {
        this.branchName = branchName;
    }

    public String getLegalPerson() {
        return legalPerson;
    }

    public void setLegalPerson(String legalPerson) {
        this.legalPerson = legalPerson;
    }

    public String getCode() {
        return code;
    }

    public void setCode(String code) {
        this.code = code;
    }

    public String getCoordinate() {
        return coordinate;
    }

    public void setCoordinate(String coordinate) {
        this.coordinate = coordinate;
    }

    public String getLeagueType() {
        return leagueType;
    }

    public void setLeagueType(String leagueType) {
        this.leagueType = leagueType;
    }

    public String getLeagueName() {
        return leagueName;
    }

    public void setLeagueName(String leagueName) {
        this.leagueName = leagueName;
    }

    public String getManagerStatus() {
        return managerStatus;
    }

    public void setManagerStatus(String managerStatus) {
        this.managerStatus = managerStatus;
    }

    public Integer getBlack() {
        return black;
    }

    public void setBlack(Integer black) {
        this.black = black;
    }

    public Integer getStarLevel() {
        return starLevel;
    }

    public void setStarLevel(Integer starLevel) {
        this.starLevel = starLevel;
    }

    public Boolean getRecord() {
        return record;
    }

    public void setRecord(Boolean record) {
        this.record = record;
    }

    public String getAddress() {
        return address;
    }

    public void setAddress(String address) {
        this.address = address;
    }

    public String getBusinessAddress() {
        return businessAddress;
    }

    public void setBusinessAddress(String businessAddress) {
        this.businessAddress = businessAddress;
    }

    public String getDistrict() {
        return district;
    }

    public void setDistrict(String district) {
        this.district = district;
    }

    public String getCity() {
        return city;
    }

    public void setCity(String city) {
        this.city = city;
    }

    public String getProvince() {
        return province;
    }

    public void setProvince(String province) {
        this.province = province;
    }

    public String getTradeType() {
        return tradeType;
    }

    public void setTradeType(String tradeType) {
        this.tradeType = tradeType;
    }

    public String getTradeTypeText() {
        return tradeTypeText;
    }

    public void setTradeTypeText(String tradeTypeText) {
        this.tradeTypeText = tradeTypeText;
    }

    public String getActorType() {
        return actorType;
    }

    public void setActorType(String actorType) {
        this.actorType = actorType;
    }

    public String getMobile() {
        return mobile;
    }

    public void setMobile(String mobile) {
        this.mobile = mobile;
    }

    public String getLicenseNo() {
        return licenseNo;
    }

    public void setLicenseNo(String licenseNo) {
        this.licenseNo = licenseNo;
    }

    public String getWorkStatus() {
        return workStatus;
    }

    public void setWorkStatus(String workStatus) {
        this.workStatus = workStatus;
    }

    public String getWorkStatusText() {
        return workStatusText;
    }

    public void setWorkStatusText(String workStatusText) {
        this.workStatusText = workStatusText;
    }
}
